﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SolutionBLL;
using SolutionModel;
using SFast;

public partial class admin_system_MenuList : System.Web.UI.Page
{

    T_MenuBLL bll = new T_MenuBLL();

    protected void Page_Load(object sender, EventArgs e)
    {
        string act = Request.QueryString["action"];
        if (act == "sort")
        {
            String mid = string.Empty;
            String mname = string.Empty;
            String pic = String.Empty;
            string sort = string.Empty;
        }
        //this.rpTreeList.DataSource = bll.GetTree();
        //this.rpTreeList.DataBind();
    }

    /// <summary>
    /// 获取菜单
    /// </summary>
    /// <returns></returns>
    public String getMenu()
    {
        String json = bll.GetTree()._ToJsonStr();
        return json;
    }

    public String GetTreeNotInCurrent()
    {
        String cid = String.Empty;
        if (!String.IsNullOrEmpty(Request["cid"]))
        {
            cid = Request["cid"];
        }
        List<TreeGridModel> list = bll.GetTreeNotInCurrent(cid);
        list = new List<TreeGridModel>(){
                new TreeGridModel(){
                    ID = 0,
                    PID = 0,
                    Name = "根目录",
                    children =list
                }
            };
        String JsonStr = list == null ? "" : list._ToJsonStr();
        //Response.Write(JsonStr);
        return JsonStr;
    }
}
